<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_General_GetData extends Zend_View_Helper_Abstract
{
    /**
     *
     */
    public function getData($field, $dataSet = null)
    {
        if (is_array($dataSet)) {
            if (isset($dataSet[$field])) {
                return $dataSet[$field];
            }
        } else if (is_object($dataSet)) {
            if (isset($dataSet->$field)) {
                return $dataSet->$field;
            }
        } else {
            return $this->view->$field;
        }
    }
}